package com.wewins.fota.sys.config;

import lombok.Getter;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.core.io.Resource;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import java.time.Duration;

@Getter
@Configuration
@EnableAspectJAutoProxy(proxyTargetClass = true, exposeProxy = true)
@EnableTransactionManagement(proxyTargetClass = true)
@MapperScan("com.wewins.fota.mapper")
public class FotaManagementConfig {
    @Value("${fota.static.log-time:1m}")
    private Duration statisticTime;

    @Value("classpath:lua/statOperator.lua")
    private Resource statOperator;

    @Value("${fota.config.path}")
    private String rootPath;

    @Value("${logging.file.path}")
    private String logPath;

    @Value("${logging.file.archive}")
    private String archivePath;

    @Bean
    public String rootPath() {
        return rootPath;
    }
}
